<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<sx:head  extraLocales="UTF-8" />
<base href="<%=basePath%>">
<title>项目管理系统 </title>
<script language="javascript" src="js/jquery-1.8.2.js"></script>
<script language="javascript" src="js/jquery-ui.js"></script>
<link rel="stylesheet" href="css/jquery-ui.css" type="text/css"/>
<script language="javascript" src="js/jquery.datepick.min.js"></script>
<script language="javascript" src="js/jquery.ui.datepicker-zh-CN.js"></script>
<link rel="stylesheet" href="jsp/skin/css/style.css" type="text/css"/>


<script language="JavaScript" type="text/javascript">

$(function(){
      alert("1");
      
      $("#dateStart").datepicker({
         showButtonPanel: true,
         showOtherMonths: true,
         dateFormat:"yy-mm-dd",
         gotoCurrent: true ,
         duration: "slow" ,
         changeYear: true,
         showOn: "both",
         changeMonth: true,
         buttonText: "日历" ,
         minDate: new Date(2007, 1 - 1, 1),
         numberOfMonths: [ 2, 3 ],
         inline:true,
         closeText: 'X'
         });
         $("#dateEnd").datepicker({
         showButtonPanel: true,
         showOtherMonths: true,
         dateFormat:"yy-mm-dd",
         gotoCurrent: true ,
         duration: "slow" ,
         changeYear: true,
         showOn: "both",
         changeMonth: true,
         buttonText: "日历" ,
         minDate: new Date(2007, 1 - 1, 1),
         numberOfMonths: [ 2, 3 ],
         inline:true,
         closeText: 'X'
         });
});
function uptAdvertAddressAct(id,hiddenId){
  alert("更新");
  selectAll();
  document.register.action="advertLogonAct!uptAdvert.action";
  document.register.submit();
}
function Register(){
   
   alert("123");
   selectAll();
   document.register.action="advertLogonAct!addTblActive.action";
   document.register.submit();
   }
   
 function pageInit(){
      <%
        Object obj = request.getAttribute("message");
      %>
      var message = '<%=obj%>';
     if(message!='null'){
       alert(message);
     }
   }
   
   function checkAll(){
       return isNull("userName")*isNull("passWord");
   }
   
   function passwordCon(){
      if(isNull("passWord")*isNull("passWordCon")==0)
      {
         alert("密码或确认密码至少有一项为空！");
         return 0;
      }else{
         if(document.getElementById("passWord").value!=document.getElementById("passWordCon").value){
             alert("密码和确认密码必须相同！");
             return 0;
          }else{
             return 1;
          }
      }
   }
   
   
//为空检验
function isNull(id){
   var idValue = document.getElementById(id).value;
     if(idValue==""){
     alert(id+"项不能为空！");
     return 0;
  }else{
    return 1;
  }
}
function selectAll(){
   var checkboxList = document.register.rightList;
   for(var i=0;i<checkboxList.length;i++){
      checkboxList[i].selected=true;
   }
}
</script>
<style type="text/css">
<!--
.atten {font-size:12px;font-weight:normal;color:#F00;}
-->
 body {
      font-family: "Trebuchet MS", "Helvetica", "Arial", "Verdana", "sans-serif";
      font-size: 62.5%;
      }
</style>
</head>

<body class="ContentBody">
  <s:form action="" method="post" name="register" id="register" enctype ="multipart/form-data">
   <s:set name="buttonFlagValue" value="%{buttonFlagValue}" />
   <s:hidden name="tblActive.id" value="%{tblActive.id}"></s:hidden>
<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
  <tr>
      <th class="tablestyle_title" >
         <s:if test="#buttonFlagValue!='upt'">活动增加
	     </s:if>
		 <s:else>活动修改
		 </s:else>
      </th>
  </tr>
  <tr>
    <td class="CPanel">
		
		<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
		<tr><td align="left">
		<input type="button" name="Submit" value="保存" class="button" onclick="alert('保存成功！');"/>　
			
			<input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/>
		</td></tr>

		<tr>
			<td width="100%">
				<fieldset style="height:100%;">
				<legend>
				  <s:if test="#buttonFlagValue!='upt'">活动增加
	              </s:if>
		          <s:else>活动修改
		          </s:else>
		        </legend>
					  <table border="0" cellpadding="2" cellspacing="1" style="width:100%">
					 
					  <tr>
					    <td align="right" width="13%">活动名字:</td>
					    <td width="41%">
					    <s:textfield name="tblActive.activeName" theme="simple"></s:textfield>
				        <span class="red"> *</span><span>长度20</span></td>
					  </tr>
					  <tr>
					    <td align="right" width="13%">描述:</td>
					    <td width="41%">
					    <s:textfield name="tblActive.notes" theme="simple"></s:textfield>
				        <span class="red"> *</span></td>
					  </tr>
					  <tr>
					    <td nowrap="nowrap" align="right" width="13%">选择参加活动的广告:</td>
						    <td width="87%" colspan="3">
						      <s:action name="codeAct!activeAdvert" id="advertInfo">
						      <s:param name="activeId" value="%{activeVo.id}"></s:param>
						      </s:action>
									<s:optiontransferselect name="leftList"
										list="#advertInfo.tblAdvertLeftList" listKey="id"
										listValue="advertName" multiple="true" emptyOption="false"
										cssStyle="width:140px;height:150px;" 
										
										doubleName="rightList"
										doubleList="#advertInfo.tblAdvertRightList" doubleListKey="id" doubleListValue="advertName"
										doubleEmptyOption="false" doubleMultiple="true"
										doubleCssStyle="width:140px;height:150px;"
										
										allowUpDownOnLeft="false" allowUpDownOnRight="false"
										addToLeftLabel="导入左侧" addAllToRightLabel="全部导入右侧"
										addAllToLeftLabel="全部导入左侧" addToRightLabel="导入右侧"
										theme="simple" allowSelectAll="false">
									</s:optiontransferselect>
								</td>
						  </tr>
					  <tr>
					    <td align="right" width="13%">开始时间: </td>
					    <td width="30%">
					       <s:textfield name="startDate" id="dateStart" theme="simple" >
　　                                                              <s:param name="value"><s:date name="startDate" format="yyyy-MM-dd"/></s:param>
　　                                                               </s:textfield>
				        <span style="font-color:red" class="red"> *</span></td>
				        <td align="right" width="13%">结束时间:</td>
				        <td width="30%">
					      <input type="text" id="dateEnd" name="endDate" value="<s:date name="endDate" format="yyyy-MM-dd" />" />
				        <span style="font-color:red" class="red"> *</span></td>
					  </tr>
					  <tr>
					    <td align="right" width="13%">活动发起人:</td>
					    <td width="30%">
					    <s:textfield name="tblActive.sponsors" theme="simple"></s:textfield>
				        <span class="red"> *</span></td>
				        <td align="right" width="13%">活动状态:</td>
					    <td width="30%">
					    <s:action name="codeAct!findState" id="defCode"></s:action>
                        <s:select theme="simple" name="tblActive.state" 
                          listKey="code" listValue="value" list="#defCode.tblStateList"/>
				        <span class="red"> *</span></td>
					  </tr>
					  <tr>
						  <td>活动参与人条件选择</td>
						  <td width="41%" colspan="3"><hr style="color:green"></hr></td>
					  </tr>
					  <tr>
						    <td nowrap="nowrap" align="right" width="13%">年龄:</td>
						    <td width="87%" colspan="3">
						      <s:textfield name="tblActive.minAge" value="%{tblActive.minAge}" theme="simple"></s:textfield>
						      到
						      <s:textfield name="tblActive.maxAge" value="%{tblActive.maxAge}" theme="simple"></s:textfield>
						      岁
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">性别:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist name="sexList" list="#{'1':'男','0':'女'}" listKey="key" listValue="value" theme="simple" />
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">体重:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'40KG以下',2:'40-60KG',3:'60-80KG',4:'80KG以上'}" name="weightList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">身高:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'160以下',2:'160-170',3:'170-180',4:'180以上'}" name="heightList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">血型:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'A型',2:'B型',3:'AB型',4:'O型'}" name="bloodList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">信仰:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'佛教',2:'基督教',3:'伊斯兰教'}" name="beliefList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">文化程度:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'小学',2:'初中',3:'高中',4:'大专',5:'本科',6:'硕士',7:'博士'}" name="degreeList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">行业:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'IT',2:'金融',3:'法律',4:'医生',5:'公务员',6:'其他'}" name="industryList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">收入:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'1000以下',2:'1000-4000',3:'4000-10000',4:'10000以上'}" name="incomeList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
						  <tr>
						    <td nowrap="nowrap" align="right" width="13%">婚否:</td>
						    <td width="87%" colspan="3">
						      <s:checkboxlist list="#{1:'已婚',2:'未婚'}" name="marriageList" listKey="key" listValue="value" theme="simple"></s:checkboxlist>
					      </td>
						  </tr>
					  <tr>
					    
					  </tr>
					  
					   
					  </table>
			 <br />
				</fieldset>			</td></tr>
		
		
		</table>
	
	
	 </td>
  </tr>
  

		
		
		
		
		<tr>
			<td colspan="2" align="center" height="50px" >
			
			  <s:if test="#buttonFlagValue!='upt'">
			    <input type="button" name="Button" value="注册" class="button" onclick="Register();"/>
			  </s:if>
			  <s:else><input type="button" name="Button" value="更新" class="button" onclick="uptAdvertAddressAct('defPath','hiddenDefPath');"/></s:else>
			</td>
		</tr>
		</table>
	

  
  
  
  


</div>
</s:form>
</body>
</html>

